package com.zhou.pattern.singleton;

/**
 * 单例模式的测试类 单例模式 一个JVM里面只有一个对象；
 * 
 * @author lenovo
 *
 */
public class ClientMain
{

	public static void main(String[] args)
	{

		for (int i = 1; i <= 10; i++)
		{
			// System.out.println(i+":hello");
			Singleton s = Singleton.getInstance();
			/*
			 * 默认调用toString方法；
			 */
			System.out.println(s.toString());
		}
		System.out.println("================");
		for (int i = 1; i <= 10; i++)
		{
			// System.out.println(i+":hello");
			Singleton2 s = Singleton2.getInstance();
			/*
			 * 默认调用tostring方法；
			 */
			System.out.println(s);
		}
		System.out.println("================");
		for (int i = 1; i <= 10; i++)
		{
			// System.out.println(i+":hello");
			Singleton2 s = Singleton2.getInstance();
			/*
			 * 默认调用tostring方法；
			 */
			System.out.println(s);
		}
	}
}
